import { _decorator, Component, Label, Sprite } from 'cc';
import { ItemData } from './ItemData';
import { InventoryData } from './InventoryData';
const { ccclass, property } = _decorator;

@ccclass('ItemUI')
export class ItemUI extends Component {

    sprite: Sprite

    amountLabel: Label

    public SetupItemUI(item: ItemData, amount: number) {
        if(item != null){
            this.sprite.spriteFrame = item.spriteFrame
            this.amountLabel.string = amount.toString()
            this.node.active = true;
        } else {
            this.node.active = false;
        }
    }

    bag: InventoryData

    action: InventoryData

    equipment: InventoryData

    index: number = -1

}